{% extends 'base.html' %}
{% block content %}

{% if form.errors %}
  <p>Your username and password didn't match. Please try again.</p>
{% endif %}
{% if next %}
  {% if user.is_authenticated %}

  <p>Your account doesn't have access to this page. To proceed, please login with an account that has access.</p>
  {% else %}

  <p>Please login to see this page.</p>
  {% endif %}
{% endif %}

<div class="container">
    <div class="row">
        <div class="col-md-4 col-md-offset-4">
            <div class="login-panel panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title">Please Sign In</h3>
                </div>
                <div class="panel-body">
                    <form method="post" action="{% url 'login' %}">
                        <p class="bs-component">
                          {% csrf_token %}
                          {{form.as_p}}
                        </p>
                        <p class="bs-component">
                            <center>
                                <input class="btn btn-success btn-sm" type="submit" value="login" />
                            </center>
                        </p>
                        <input type="hidden" name="next" value="{{ next }}" />
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>

{% endblock %}
{% block javascript %}


<script>
    {% if not user.is_authenticated %}
    $("ul.nav.navbar-nav.navbar-right").css("display", "none");

    {% endif %}
</script>

{% endblock %}
